//
//  WuLiuViewController.m
//  Experss
//
//  Created by wmwMAC on 17/8/9.
//  Copyright © 2017年 嗯，大葱. All rights reserved.
//

#import "WuLiuViewController.h"

#import "WuLiuTielTableViewCell.h"
#import "WuLiuTableViewCell.h"


static NSString *wuliuIdentifier = @"WuLiuTielTableViewCell";
static NSString *Identifier = @"WuLiuTableViewCell";

@interface WuLiuViewController ()<UITableViewDelegate,UITableViewDataSource>
@property (nonatomic, strong) UITableView *tableView;
@end

@implementation WuLiuViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    self.navigationItem.title = @"物流信息";
    
    [self addTableviewUI];
}

- (void)addTableviewUI {
    
    self.tableView = [[UITableView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, kScreenHeight) style:UITableViewStylePlain];
    self.tableView.delegate = self;
    self.tableView.dataSource = self;
    self.tableView.rowHeight = 80;
    self.tableView.backgroundColor = BaseColor;
    [self.tableView registerNib:[UINib nibWithNibName:@"WuLiuTielTableViewCell" bundle:nil] forCellReuseIdentifier:wuliuIdentifier];
    [self.tableView registerNib:[UINib nibWithNibName:@"WuLiuTableViewCell" bundle:nil] forCellReuseIdentifier:Identifier];

    [self.view addSubview:self.tableView];
}
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return 5;
}

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
    return 1;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    
    if (indexPath.row == 0) {
        WuLiuTielTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:wuliuIdentifier forIndexPath:indexPath];
        
        
        cell.selectionStyle = UITableViewCellSelectionStyleNone;
        
        
        cell.backgroundColor = BaseColor;
        return cell;
    }else{
        WuLiuTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:Identifier forIndexPath:indexPath];
        
        if (indexPath.row == 1) {
            cell.titleLine.hidden = YES;
            cell.imgView.image = [UIImage imageNamed:@"wuliu_quan1"];
            [cell.NameLable setTextColor:BaseBlueColor];
            [cell.dataLable setTextColor:BaseBlueColor];

        }else{
            cell.titleLine.hidden = NO;
            cell.imgView.image = [UIImage imageNamed:@"wuliu_quan2"];
            [cell.NameLable setTextColor:[UIColor blackColor]];
            [cell.dataLable setTextColor:[UIColor lightGrayColor]];

        }
        
        
        cell.selectionStyle = UITableViewCellSelectionStyleNone;
        return cell;

    }
    
}

- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section {
        return 0.01;
}
- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section {
    UIView *headerView = [[UIView alloc] init];
    headerView.backgroundColor = BaseColor;
    
    return headerView;
}

- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section {
    return 20;
}

- (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section {
    UIView *footview = [[UIView alloc] init];
    footview.backgroundColor = BaseColor;
    
    return footview;
}


- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
